package com.echat.business.book.controller;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.echat.business.book.model.FriendLink;
import com.echat.business.book.service.IFriendLinkService;
import com.echat.core.constant.response.ResponseData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author chentl
 * @version V1.0
 * @Project FriendController
 * @Title FriendController.java
 * @Description 友情链接--广告栏位 控制器
 * @Package com.echat.business.book.controller
 * @date 2019/6/6 13:24
 * @Copyright: 上海顺益信息科技有限公司 All rights reserved.
 */
@RestController
@Slf4j
@RequestMapping("/friend")
public class FriendController {

    @Autowired
    private IFriendLinkService friendLinkService;

    @RequestMapping(value = "/linkList")
    public ResponseData getFriendLinkList() {
        Wrapper<FriendLink> wrapper = new EntityWrapper<>();
        wrapper.orderBy("id asc");
        List<FriendLink> friendLinkList = friendLinkService.selectList(wrapper);
        return new ResponseData(true, 200, "获取友情链接列表成功", friendLinkList);
    }

}
